package com.linx.common.translation.core.impl;

import com.linx.common.core.service.PlaceService;
import com.linx.common.translation.annotation.TranslationType;
import com.linx.common.translation.constant.TransConstant;
import com.linx.common.translation.core.TranslationInterface;
import lombok.AllArgsConstructor;


/**
 * 区域名称翻译实现类
 * @author linx
 * @date 2024/10/14
 */
@AllArgsConstructor
@TranslationType(type = TransConstant.PLACE_ID_TO_NAME)
public class PlaceNameTranslationImpl implements TranslationInterface<String> {

    private final PlaceService placeService;


    @Override
    public String translation(Object key, Object key2, String other, Class<?> clazz) {
        if (key == null || key.toString().isEmpty()) {
            return null;
        }

        return placeService.getPlaceNameById(key.toString());
    }
}
